package net.finnigin.process;

import java.util.List;

public class GobbledProcess extends RunnableProcess {
	protected InputStreamGobbler inputStreamGobbler;
	protected InputStreamGobbler errorStreamGobbler;

	public GobbledProcess(List<String> command) {
		super(command);
		inputStreamGobbler = new InputStreamGobbler();
		errorStreamGobbler = new InputStreamGobbler();
	}
	
	@Override
	protected void afterProcessStart() {
		inputStreamGobbler.setInputStream(process.getInputStream());
		inputStreamGobbler.startGobbling();
		errorStreamGobbler.setInputStream(process.getErrorStream());
		errorStreamGobbler.startGobbling();
	}

	@Override
	protected void doFinally() {
		//inputStreamGobbler.stopGobbling();
		//errorStreamGobbler.stopGobbling();
	}
}
